<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
	window.onload = function()
	{
		 var oTxt1= document.getElementById('txt1');
			var oTxt2= document.getElementById('txt2');
			var oBtn= document.getElementById('btn1');
			
			oTxt1.onkeydown = function(ev)
			{
				 var oEvent = ev || event;
					if(oEvent.keyCode==13)
						{
								oTxt2.value+= oTxt1.value +'\n';
					
								oTxt1.value ='';
						}
			};
			
	}
	</script>
</head>

<body>
<input type="text" id="txt1"><br>
<textarea name="" id="txt2" cols="30" rows="10"></textarea>
</body>
</html>
